package site.jlopen.kuscia.rpc;

import org.secretflow.v1alpha1.common.Common;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public abstract interface KusciaRpc {
	static Logger logger = LoggerFactory.getLogger(KusciaRpc.class);
	
	default void checkResponse(Common.Status status) throws Exception {
		logger.error("响应状态：{}", status);
		if (status.getCode() != 0) {
			throw new Exception(status.getMessage());
		}
	}
	/*default void checkResponse(Common.Status status) {
		if (status.getCode() != 0) {
			throw SecretpadException.of(KusciaGrpcErrorCode.RPC_ERROR, status.getMessage());
		}
	}*/

}